import { cloneDeep } from 'lodash-es'
import { BwVxeComNameEnum } from '../../../render/enums'

import { vxeTableOptions } from './src/table'
import { vxeColgroupOptions } from './src/colgroup'
import { vxeColumnOptions } from './src/column'

import type { BwDesignNodeComDefaultOptionModel } from '../../model'

/** 获取组件默认配置信息 */
export function getVxeComDefaultConfig(comCode: BwVxeComNameEnum) {
  const data: BwDesignNodeComDefaultOptionModel = {
    attrs: null,
    enableSlotList: null,
  }
  switch (comCode) {
    case BwVxeComNameEnum.VxeTable: {
      data.attrs = cloneDeep(vxeTableOptions.attrs)
      data.enableSlotList = cloneDeep(vxeTableOptions.slotList)
      break
    }
    case BwVxeComNameEnum.VxeColgroup: {
      data.attrs = cloneDeep(vxeColgroupOptions.attrs)
      data.enableSlotList = cloneDeep(vxeColgroupOptions.slotList)
      break
    }
    case BwVxeComNameEnum.VxeColumn: {
      data.attrs = cloneDeep(vxeColumnOptions.attrs)
      data.enableSlotList = cloneDeep(vxeColumnOptions.slotList)
    }
  }
  return data
}
